package com.lrkj.back.service.impl;

import java.util.List;
import java.util.Map;

import com.lrkj.back.mapper.ZsEquipMapper;
import com.lrkj.back.entity.ZsEquip;
import com.lrkj.back.service.ZsEquipService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import cn.com.cbons.mamisay.parent.db.api.DBInterface;
import cn.com.cbons.mamisay.parent.exception.DBException;
import cn.com.cbons.mamisay.parent.service.base.ParentServiceImpl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;

@Transactional
@Service("zsEquipService")
public class ZsEquipServiceImpl extends ParentServiceImpl<ZsEquip> implements ZsEquipService {
    @Autowired
    private ZsEquipMapper zsEquipMapper;

    @Override
    protected DBInterface<ZsEquip> getDao() throws DBException {
        return zsEquipMapper;
    }

    @Override
    public List<ZsEquip> findAllZsEquipListNoPage(Map<String, Object> map) throws DBException {
        return zsEquipMapper.findAllZsEquipList(map);
    }

    @Override
    public PageInfo<ZsEquip> findAllZsEquipList(Map<String, Object> map) throws DBException {
        PageHelper.startPage(Integer.valueOf(map.get("pageNo").toString()),
                Integer.valueOf(map.get("pageSize").toString()));
        List<ZsEquip> list = zsEquipMapper.findAllZsEquipList(map);
        PageInfo<ZsEquip> zsEquip = new PageInfo<ZsEquip>(list);
        return zsEquip;
    }

    @Override
    public List<ZsEquip> findEquipListByType(Map<String, Object> map) throws DBException {
        return zsEquipMapper.findEquipListByType(map);
    }

    @Override
    public ZsEquip findequipFangshi(Map<String, Object> map) throws DBException {
        return zsEquipMapper.findequipFangshi(map);
    }

    @Override
    public ZsEquip selectByEquipNo(Map<String, Object> map) throws DBException {
        return zsEquipMapper.selectByEquipNo(map);
    }
}
